/*
 * @Description: 
 * @Author: rendc
 * @Date: 2022-10-18 11:14:23
 * @LastEditors: rendc
 * @LastEditTime: 2022-10-19 10:12:22
 */
// pages/main/main.js
import Notify from '@vant/weapp/notify/notify';

Page({
  /**
   * 页面的初始数据
   */
  data: {
    activeKey: "0",
    value: "",//首页搜索框关键字
    searchImg: "https://img.youpin.mi-img.com/static/weex_images/v1/m/navi_title_v6.png",
    active: 1, //tabbar的初始页面
    imgs: [
      { src: "https://res.youpin.mi-img.com/youpinoper/01b05157_a3d0_4e25_98e4_587c7b54dde1.png@base@tag=imgScale&h=320&w=750" },
      { src: "https://res.youpin.mi-img.com/youpinoper/d25a7d06_f89a_4ad6_9581_f102ecf027e0.jpeg@base@tag=imgScale&h=320&w=750" },
      { src: "https://res.youpin.mi-img.com/youpinoper/dce715a5_2cd7_41fd_a496_5b592df0f528.png@base@tag=imgScale&h=320&w=750" },
    ],
    gridData: [
      { icon: 'https://img.youpin.mi-img.com/ferriswheel/p0kgmu4q3jo_22028918941626688453905.png@base@tag=imgScale&h=120&w=120', text: '上新精选', url: '../index/index' },
      { icon: 'https://img.youpin.mi-img.com/ferriswheel/jqdqm5q81n8_22028918941626687376754.png@base@tag=imgScale&h=120&w=120', text: '小米众筹', url: '../index/index' },
      { icon: 'https://img.youpin.mi-img.com/ferriswheel/aphcvmd2gvg_22028918941626688016327.png@base@tag=imgScale&h=120&w=120', text: '有品秒杀', url: '../index/index' },
      { icon: 'https://img.youpin.mi-img.com/ferriswheel/ea317c7c_ef18_4ee7_91ab_15fa62c72e19.png@base@tag=imgScale&h=120&w=120', text: '生活优选', url: '../index/index' },
      { icon: 'https://img.youpin.mi-img.com/sketch/79ca50c5_dc92_41da_bf5d_08ea24bb9652.png@base@tag=imgScale&h=120&w=120', text: '小米自营', url: '../index/index' },
    ]
  },
  onChange (event) {
    // event.detail 的值为当前选中项的索引
    this.setData({ active: event.detail });
  },
  onSidebarChange (event) {
    Notify({ type: 'primary', message: event.detail });
    this.setData({ activeKey: event.detail });
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage () {

  }
})